<?php

namespace Coding\php;

\Co::set(['hook_flags' => SWOOLE_HOOK_ALL]);

date_default_timezone_set('Asia/Shanghai');
define('ROOT', __DIR__ . DIRECTORY_SEPARATOR);
define('IS_WIN', strpos(php_uname(), 'Windows') !== false);

include_once ROOT . '../vendor/autoload.php';


function console_log($msg, $addSpace = false)
{
    $time = date('Y-m-d H:i:s');
    $msg = $time . " $msg \n";
    if ($addSpace) {
        $msg .= PHP_EOL;
    }
    echo IS_WIN ? mb_convert_encoding($msg, 'UTF8') : $msg;
}
